#coding:utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')

import MySQLdb
from redis.client import Redis
import confs

#mysql connection
def db_connect():
	try:
		conn = MySQLdb.connect(**confs.db_info)
		cur = conn.cursor()
		return conn,cur
	except Exception as e:
		raise e

#redis connection
def redis_connect():
	try:
		redis_conn = Redis(**confs.redis_info)
		return redis_conn
	except Exception as e:
		raise e
	